{% extends 'TopxiaWebBundle:Settings:layout.html.twig' %}
{% block title %}{{'安全设置'|trans}} - {{ parent() }}{% endblock %}
{# {% set script_controller = 'settings/security' %}  #}
{% set side_nav = 'security' %}

{% block main %}
 {% embed "TopxiaWebBundle:Bootstrap:panel.html.twig" with {class:'panel-col'} %}
    {% block heading %}{{'安全设置'|trans}}{% endblock %}
    {% block body %}
    {{ web_macro.flash_messages() }}

      <div class="row safety-setting" style="margin-top:10px;">
        <div class="col-xs-2 tar">
          <span class="glyphicon glyphicon-info-sign {% if progressScore > 67 %}text-success{% elseif progressScore > 34 %}text-warning{% else %}text-danger{% endif %}" style="font-size:20px;"></span>
        </div>
      <div class="col-sm-6 col-xs-5">
        <div class="progress mbs">
          <div class="progress-bar" role="progressbar" style="width: {{ progressScore }}%;"></div>
        </div>
      </div>
      <div class="col-sm-4 col-xs-5">
        {% if progressScore > 67 %}
          <span class="text-success" style="display:block;">{{'安全等级：高'|trans}}</span>
        {% elseif progressScore > 34 %}
        <span class="text-warning" style="display:block;">{{'安全等级：中'|trans}}</span>
        {% else %}
          <span class="text-danger" style="display:block;">{{'安全等级：低'|trans}}</span>
        {% endif %}
      </div>
    </div>

    <hr>

    <div class="row">
      <div class="col-xs-2 tar
        {% if hasLoginPassword %}
          text-success
        {% else %}
          text-danger
        {% endif %}
      " style="font-size:20px">
        {% if hasLoginPassword %}
          <span class="glyphicon glyphicon-ok"></span>
        {% else %}
          <span class="glyphicon glyphicon-warning-sign"></span>
        {% endif %}
      </div>

      <span class="col-sm-3 col-xs-6" style="margin-top: 5px;" >{{'登录密码'|trans}}</span>

      <span class="col-sm-4 hidden-xs" style="margin-top: 5px;" >{{'登录网校时需要输入的密码'|trans}}</span>

      <a href="{{ path('settings_password') }}" class="col-xs-offset-1 btn btn-primary" style="margin-top: -3px;" >{{'修改'|trans}}</a>
    </div>
    <hr>

    <div class="row">
      <div class="col-xs-2 tar
        {% if hasPayPassword %}
          text-success
        {% else %}
          text-danger
        {% endif %}
      " style="font-size:20px">
        {% if hasPayPassword %}
          <span class="glyphicon glyphicon-ok"></span>
        {% else %}
          <span class="glyphicon glyphicon-warning-sign"></span>
        {% endif %}
      </div>

      <span class="col-sm-3 col-xs-6" style="margin-top: 5px;" >{{'支付密码'|trans}}</span>

      <span class="col-sm-4 hidden-xs" style="margin-top: 5px;" >{{'在网校进行消费行为时需要输入的密码'|trans}}</span>

      {% if hasPayPassword %}
        <a href="{{ path('settings_reset_pay_password') }}" class="col-xs-offset-1 btn btn-primary" style="margin-top: -3px;" >{{'重置'|trans}}</a>
      {% else %}
        <a href="{{ path('settings_pay_password') }}" class="col-xs-offset-1  btn btn-primary" style="margin-top: -3px;" >{{'设置'|trans}}</a>
      {% endif %}

    </div>
    <hr>

    <div class="row">
      <div class="col-xs-2 tar
        {% if hasFindPayPasswordQuestion %}
          text-success
        {% else %}
          text-danger
        {% endif %} "
        style="font-size:20px">

        {% if hasFindPayPasswordQuestion %}
          <span class="glyphicon glyphicon-ok"></span>
        {% else %}
          <span class="glyphicon glyphicon-warning-sign"></span>
        {% endif %}
      </div>

      <span class="col-sm-3 col-xs-6" style="margin-top: 5px;" >{{'安全问题'|trans}}</span>

      <span class="col-sm-4 hidden-xs" style="margin-top: 5px;" >{{'通过设置并且验证安全问题，保护帐号密码安全。'|trans}}</span>

      <a href="{{ path('settings_security_questions') }}" class="col-xs-offset-1 btn btn-primary" style="margin-top: -3px;" >
      {% if hasFindPayPasswordQuestion %}
        {{'查看'|trans}}
      {% else %}
        {{'设置'|trans}}
      {% endif %}

      </a>
    </div>

    {% if (setting('cloud_sms.sms_enabled')|default('')) == '1' and (setting('cloud_sms.sms_bind')|default('')) == 'on' %}
      <hr>

      <div class="row">
        <div class="col-xs-2 tar
          {% if hasVerifiedMobile %}
            text-success
          {% else %}
            text-danger
          {% endif %} "
          style="font-size:20px">

          {% if hasVerifiedMobile %}
            <span class="glyphicon glyphicon-ok"></span>
          {% else %}
            <span class="glyphicon glyphicon-warning-sign"></span>
          {% endif %}
        </div>

        <span class="col-sm-3 col-xs-6" style="margin-top: 5px;" >{{'手机绑定'|trans}}</span>

        <span class="col-sm-4 hidden-xs" style="margin-top: 5px;" >{{'增加账户登录、购买课程时的安全性，同时还可以找回登录密码，支付密码。'|trans}}</span>

        <a href="{{ path('settings_bind_mobile') }}" class="col-xs-offset-1 btn btn-primary" style="margin-top: -3px;" >
        {% if hasVerifiedMobile %}
          {{'修改'|trans}}
        {% else %}
          {{'绑定'|trans}}
        {% endif %}
        </a>
      </div>
    {% endif %}

    {% endblock %}
  {% endembed %}
{% endblock %}